package com.example.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ConUserRoleMapper {
    @Insert("insert into con_user_role(userId, roleId) values(#{userId}, 1)")
    int addUserRoleUser(@Param("userId") Integer userId);

    @Insert("insert into con_user_role(userId, roleId) values(#{userId}, 2)")
    int addUserRoleEmployee(@Param("userId") Integer userId);

    @Select("select roleId from con_user_role where userId = #{userId}")
    int getRoleByUserId(@Param("userId") Integer userId);
}
